//
//  DSGZSearchTabController.m
//  budejie
//
//  Created by tangQiang on 8/24/16.
//  Copyright © 2016 Dason. All rights reserved.
//

#import "DSGZSearchTabController.h"
#import "DSGZSearchBar.h"

@implementation DSGZSearchTabController
#pragma mark - view did load
- (void)viewDidLoad {
    
    // 设置 NavgationBar 上的所有参数
    [self setNavgationBarAllAttributes];
    
}

#pragma mark - 设置 NavgationBar 上的所有参数
- (void)setNavgationBarAllAttributes {

    // 添加中心搜索框
    DSGZSearchBar *searchBar = [[DSGZSearchBar alloc]init];
    [searchBar sizeToFit];
//    searchBar.showsSearchResultsButton = YES;
//    searchBar.showsBookmarkButton = YES;
//    // searchBar.showsCancelButton = YES;
//    searchBar.showsScopeBar = YES;
//    searchBar.s

    self.navigationItem.titleView = searchBar;
    

    // right item : 缺少图片暂时用系统的
    UIButton *rightBtn = [[UIButton alloc]init];
    [rightBtn sizeToFit];
    rightBtn.bounds = CGRectMake(0, 0, 38, 44);
    // 字体颜色
    [rightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];
    // 字体大小
    [rightBtn setTitle:@"搜索" forState:UIControlStateNormal];
    [rightBtn setTitle:@"搜索" forState:UIControlStateHighlighted];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
}

@end
